home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / Pascal / Book Demos in Pascal / SpriteEngine / SE Random / SpriteStructure.p < prev   
Encoding:
Text File  |  1995-04-06  |  837 b   |  37 lines  |  [TEXT/MWPS]

  1. unit SpriteStructure;
  2.  
  3. {This unit defines the SpriteRecord structure. It i a separate unit since it}
  4. {is likely to be edited.}
  5.  
  6. interface
  7.  
  8. {$setc _hasfixedpoint := true}
  9.  
  10. {$IFC UNDEFINED THINK_PASCAL}
  11.     uses Types, QuickDraw;
  12. {$ENDC}
  13.  
  14.     type
  15.         EntityType = (    randomPositionSprite,
  16.     randomSpeedSprite,
  17.     randomImpulseSprite,
  18.     changeSometimesSprite
  19. );
  20.  
  21.         SpritePtr = ^SpriteRecord;
  22.         SpriteRecord = record
  23. (*Game entity data - edit as desired*)
  24.                 kind: EntityType;
  25.                 speed: Point;                (* Fixed-point! *)
  26.                 fixedPointPosition: Point;
  27. (*Sprite data - don't remove*)
  28.                 position: Point;            (* Integer screen coordinates! *)
  29.                 face: GrafPtr;                (* Apprearance of the sprite *)
  30.                 drawingRect: Rect;        (* Where is it? *)
  31. (*List pointers - don't remove*)
  32.                 prev, next: SpritePtr;        (* Next enity in the list *)
  33.             end;
  34.  
  35. implementation
  36. end.
  37.